<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=@page_title || "专业测评系统"%></title>
<link href="/stylesheets/survey_public.css" rel="stylesheet" type="text/css" />

<script language="javascript"> 
    function printsetup()  {
            web.execwb(8,1); // 打印页面设置
    }
    function printpreview()  {
            web.execwb(7,1); //打印页面预览
    }
    function copyToClipBoard()  {
            var clipBoardContent="";
            clipBoardContent+=document.title;
            clipBoardContent+="\n";
            clipBoardContent+=this.location.href;
            window.clipboardData.setData("Text",clipBoardContent);
            alert("复制成功，粘贴即可！");
    }
</script>

<style>
#content{ width:885px; float:left;}
.content01{ width:885px; float:left; height:42px; border-bottom:1px solid #1a80d0;}
.content01 ul{ width:748px; float:left; padding-left:80px;}
.content01 ul li{ width:69px; float:left; border-right:1px dashed #1a80d0; height:42px; line-height:42px; text-align:center; color:#000000;}
.content01 ul li.bb{ width:49px;}
.content01 ul li.bb02{ width:39px;}
.content01 ul li.bb03{ width:105px;}
.content01 ul li.bb04{ width:180px; border-right:none;}

.content02{ width:715px; float:left; padding:36px 0 0 80px;}
#tj{ width:500px; height:44px; float:left;}
#tj li{ width:107px; height:44px; float:left;}
#tj li.jj{ width:200px; height:30px; float:left; border:1px solid rgb(218, 218, 218); text-align:center; line-height:30px; color:#000000; margin-top:12px;}

#df{ width:450px; float:left; margin:15px  0 ;}
#df li{ width:131px; float:left;}
#df li.ff{ width:209px; float:left; margin-top:15px;}

#dimen{ width:680px; float:left; margin-top:15px;}
#dimen li.ff{ width:400px;  float:left; margin:15px  0 ;}
#dimen li.ff2{ width:209px;  float:left; margin:50px  0 10px  0 ;}

#dimen_ex{ width:450px; float:left; margin-top:15px;}
#dimen_ex li{ width:131px; float:left; }
#dimen_ex li.right{ width:209px;  float:left; margin:15px  0 ;}

.bian{ width:209px; height:1px; background:#dadada;}
#bg{ width:610px; float:left; margin:15px  0 ;}
#bg li{ width:72px; float:left;}

.back{ width:102px; height:35px; float:right; padding-right:20px; margin:20px 5px 0 0;}
#footer{ width:100%; height:200px; float:left; background:url(/images/user/report/footer.jpg) no-repeat; text-align:center; color:#295c72;}
#footer h1{ margin-top:100px;}

table tr td{padding:2px 10px 2px 10px; }
</style>

<style type="text/css" media="print">
  .noprint{display : none }
</style>
</head>

<body>
<div id="page">
	<div id="header">
		<ol>
                  <li id="title-text"><%= @test_record.survey.name %></li>
		</ol>
		<ul>
                  <li id="org-text">
                  <%=current_user.name%>
                </li>
                  <li style="margin:0 20px 0 0;"><a href="/login/logout">安全退出</a></li>
		</ul>
        </div>
	<div id="content">
    	<div class="content01">
        	<ul>                                           
            <li>姓名</li>
            <li><%=@test_record.username%></li>
            <li>性别</li>
            <li class="bb"><%=@test_record.gender%></li>
            <li>年龄</li>
            <li class="bb02"><%=@test_record.age%></li>
            <li class="bb03">测量日期</li>
            <li class="bb04"><%=@test_record.created_at.strftime('%Y年 %m月%d日')%></li>
            </ul>
        </div>
        <div class="content02">
       	  <ul id="tj">
            <li><img src="/images/user/report/01_03.jpg" width="42" height="18" /></li>
             <% if @test.show_total==true%>
          <% if  @test.formula and @test.formula.size > 0  %>
            <li class="jj"> 总分：<%=count_by_formula(@total, @test.formula) %>　　　
           <% else %>
           <li class="jj"> 总分：<%= @total %>　　　
           <% end %>
          <% end %>
           <% if @test.show_avg==true%>
            均分：<%= eval(sprintf("%8.2f", @avg))%>
           <% end %>
           </li>
          </ul>
          
       <% if @test.has_part == 1 %>
        <% if @test.show_parts ==true%>
            <ul id="df">
            <li><img src="/images/user/report/02_03.jpg" width="102" height="21" /></li>
            <li class="ff">
              <table width="" border="0" cellspacing="0" cellpadding="0" style="border-left:1px solid #dadada; border-top:1px solid #dadada;">
  <tr align="center">              
    <td width="" height="27" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:30px">分量表</td>
    <td width="" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada">分值</td>
    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada">均分</td>
  </tr>
  <% @part_results.each do |p| %>
                  <% if Part.find(p.part_id).formula  and Part.find(p.part_id).formula.size > 0%>
                  <tr align="center">
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=Part.find(p.part_id).name%></td>
                    <% if Part.find(p.part_id).show_total == true%>
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=count_by_formula(p.total, Part.find(p.part_id).formula)%></td>
                    <% else %>
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px">/</td>
                    <% end %>
                    <% if Part.find(p.part_id).show_avg == true%>
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=eval(sprintf("%8.2f", p.avg))%></td>
                     <% else %>
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"> /</td>
                    <% end %>
                  </tr>
                  <% else %>
                  <tr align="center">
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=Part.find(p.part_id).name%></td>
                    <% if Part.find(p.part_id).show_total == true%>
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=p.total%></td>
                     <% else %>
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"> / </td>
                     <% end %>
                    <% if Part.find(p.part_id).show_avg == true%>
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=eval(sprintf("%8.2f", p.avg))%></td>
                     <% else %>
                    <td  style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"> / </td>
                     <% end %>
                  </tr>
                  <% end %>
              <% end %>
            </table>
            </li>
            </ul>
              <% end %>
        <% end %>
        
        
        
   

        <% if @test.has_dimen && @test.show_dimens ==true %>
        <ul id="yinzi" style="width:780px; float:left; margin-top:15px;">
            <li><img src="/images/user/report/yinzidefen.jpg"  /></li><br />
            </ul>
            <!--fusion charts -->
          <ul id="dimen">  
               <li class="ff">
        <% datas_url = "/user/reports/report_xml/"+@test_record.id.to_s %>
              <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="200" height="300" id="Column3D" >
                 <param name="movie" value="/charts/FCF_Column2D.swf" />
                 <param name="FlashVars" value="&dataURL=<%=datas_url%>&chartWidth=400&chartHeight=300">
                 <param name="quality" value="high" />
                 <embed src="/charts/FCF_Column2D.swf" flashVars="&dataURL=<%=datas_url%>&chartWidth=400&chartHeight=300"
                          quality="high" width="390" height="300" name="Column3D"
                          type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
              </object>
              </li>
            <!--fusion charts-->
            
            <li class="ff2">
              <table width="" border="0" cellspacing="0" cellpadding="0" 
              style="border-left:1px solid #dadada; border-top:1px solid #dadada;">
            <tr align="center">              
              <td width="" height="27" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:30px">因子</td>
              <td width="" style="border-bottom:1px solid #dadada; border-right:1px solid #dadada">分值</td>
              <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada">均分</td>
            </tr>
              <% @dimen_results.each do |d| %>
                  <% if  Dimen.find(d.dimen.id).formula and Dimen.find(d.dimen.id).formula.size > 0%>
                  <tr>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=Dimen.find(d.dimen.id).name%></td>
                    <% if Dimen.find(d.dimen.id).show_total == true%>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=count_by_formula(d.total, Dimen.find(d.dimen.id).formula)%></td>
                    <% else %>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px">/</td>
                    <% end %>
                    <% if Dimen.find(d.dimen.id).show_avg == true%>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%= eval(sprintf("%8.2f", d.avg)) %></td>
                    <% else %>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"> / </td>
                     <% end %>
                  </tr>
                  <% else  %>
                   <tr>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=Dimen.find(d.dimen.id).name%></td>
                    <% if Dimen.find(d.dimen.id).show_total == true%>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%=d.total%></td>
                    <% else %>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px">/</td>
                    <% end %>
                    <% if Dimen.find(d.dimen.id).show_avg == true%>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"><%= eval(sprintf("%8.2f", d.avg)) %></td>
                    <% else %>
                    <td style="border-bottom:1px solid #dadada; border-right:1px solid #dadada; height:20px"> / </td>
                     <% end %>
                  </tr>
                  <% end %>
              <% end %>
            </table>
          </li>
           </ul>
        <ul id="dimen_ex">
        <!--因子解释-->
         <% if @test.show_expl == true%>
           <li><span ><img src="/images/user/report/yinzijieshi.jpg"></span><br /></li>
           <li class="right">
           <% @dimen_results.each do |d| %>
           <% dimen=Dimen.find(d.dimen.id)%>
                <%=dimen.name %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;得分：<%=d.total%> 
               <br />
                &nbsp;&nbsp;&nbsp;&nbsp;
                <%=find_expl(dimen.id , d.total)%>
                <br />
           <% end %>
           </li>
           <% end %>
         </ul>
        <% end %>
        
            <ul id="bg">
              <li><img src="/images/user/report/bg.jpg" width="47" height="18" /></li>
            </ul>

        </div>

          <div style="margin-left:150px;">
            <iframe name="inner" id="inner" src="/user/reports/_report/<%= @test.norm_info.id %>" marginwidth="0" marginheight="0"
                    frameborder="0" scrolling="no" width="100%" onload="this.height=this.contentWindow.document.body.scrollHeight+40">
            </iframe>
          </div>
        <div  style="margin-left:150px;width:500px;height:150px;">
        <input type="textarea" name="zxs_yj" width="450" height="150"></input>
        
        </dv>
          <!--div style="margin-left:70px;">
            <%= @test.norm_info.description %>
          </div->
          
                  <!--打印功能-->
         <!--div class="msg" id="webprint" style="mrgiin:10px 100px 0 0;float:right; width:250px;">
      <object classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" id="web" name="web" height="0" width="0"></object>
      <input type="button" value="  打  印 " onclick="javascript:window.print();" />
      <input type="button" value="打印预览" onclick="window.print();" />
      <br /><br />
       
      </div-->
         <!-- webprint -->
        <div class="back">
          <a href="/user/reports"><img src="/images/back.png" width="88" height="27" style="margin-left:10px;"/></a>
        </div>
    </div>
</div>
<div id="footer">
<h1>北京心嘉源咨询有限公司 CopyRight © www.iyaoi.cn 2009</h1>
</div>
</body>
</html>
